package com.howie.hmvc.handler;

import java.lang.reflect.Method;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public interface IInvokeHandler {

	/**
	 * 方法调用前执行
	 * @param method
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public boolean beforeInvoke(Method method,HttpServletRequest request,
			HttpServletResponse response)throws Throwable;
	
	/**
	 * 方法调用后执行
	 * @param method
	 * @param throwable	非空值表示方法抛出了异常
	 * @param result
	 * @param request
	 * @param response
	 * @throws Exception
	 */
	public void afterInvoke(Method method,Throwable throwable,Object result,HttpServletRequest request,
			HttpServletResponse response)throws Throwable;
	
}
